The invention relates to a method and a device for transmitting data packets. In particular, the invention relates to a method and a device for transmitting data packets from an elementary MPEG stream in a transport stream.
In xe2x80x9cInformation technologyxe2x80x94Generic coding of moving pictures and associated audio informationxe2x80x94Part 1: Systemsxe2x80x9d, published Dec. 1, 1993, as Draft International Standard ISO/IEC CD 13818-1, and hereinafter referred to as CD 13818-1, a system is disclosed for transmitting MPEG encoded video and audio signals as well as data. Elementary MPEG streams of data are packetized. The packets are multiplexed so as to form a program stream or a transport stream. The transport stream thus constitutes a packet-based time multiplex transmission channel. Data is transmitted in transport packets of 188 bytes each. Each transport packet belongs to exactly one elementary stream. One or more elementary streams make up a program. Each elementary stream has a data rate, which may be variable or constant.
Since more than one elementary streams share one transport stream, and because of quantization effects due to the fixed length of a transport packet, the spacing of the transport packets of one elementary stream will not be uniform. This effect is referred to as xe2x80x9cjitterxe2x80x9d. This is illustrated in FIG. 1 which shows an example of a typical transport stream. The packets P1,P2, . . . shown in the Figure are packets from one elementary stream. Due to jitter they are not equally spaced.
To compensate for jitter, a video or audio decoder will have to have a buffer oversize. On page 15 of CD 13818-1, said buffer oversize is specified as a portion of the decoder buffer size. The jitter may never be so large that it causes an underflow (packet arriving too late) or an overflow (packet arriving too early) of the buffer in the Target Decoder. A transport stream fulfilling this and other requirements is referred to as a xe2x80x9clegalxe2x80x9d MPEG2 transport stream.
In many applications, it will be necessary to perform a remultiplexing of a transport stream. A remultiplexing operation is understood to mean any operation which has one or more legal MPEG2 transport streams as input stream and produces a legal MPEG2 transport stream as the output stream. Examples of remultiplexing operations are:
1) Joining several transport streams containing one program to a multi-program transport stream,
2) Adding a program to a multi-program transport stream, creating a new transport stream,
3) Selecting some programs from a multi-program transport stream, creating a new transport stream, and
4) Recording one program selected from a multi-program transport stream.
The problem in a remultiplexing operation is that the remultiplexer cannot know the original scheduling moment of a certain transport packet belonging to a certain elementary stream. When the remultiplexer produces its output stream, it may be impossible to schedule the packet in the right position. The remultiplexer must then choose whether to schedule the packet earlier or later. In both cases, the jitter of that packet is changed. Since the remultiplexer does not know the original scheduling moment, it cannot be sure that the output stream is legal.
Furthermore, the draft MPEG2 systems standard CD 13818-1 allows the transmission of elementary streams having a variable bit-rate. After a certain number of remultiplexing steps, the jitter added by each step will have changed the momentary rate of the elementary stream in an unpredictable manner. It is not possible to reconstruct the original rate because no information about the original scheduling moment of a certain packet is available.
It is an object of the invention to provide a method of transmitting data packets in which the above mentioned problems are alleviated.
According to the invention, the method of transmitting data packets from an elementary stream of data packets into an output stream of data packets comprises the step of associating a time window with a data packet and accommodating position information in the packet about the position of said data packet within said window. A packet can then be scheduled anywhere within said window without violating buffer constraints.
In a preferred embodiment of the invention, the position information takes the form of a parameter included in said data packet, for example the offset of the start of the packet with reference to the start of the window.
Transmitting the offset parameter in each packet would create too much overhead. Therefore, in yet another embodiment, the position information includes a further parameter representing the distance between the time windows associated with successive data packets from the same elementary stream. The-position information of other packets can then be calculated.